<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<script type="text/javascript">
	$(function() {
		validReg("updateForm");
	});
</script>

<div class="page-content">
	<!--content-->
	<div class="containerTop">
		<a href="javascript:menuUrl('role/view', 'role:page');" class="a-back"><span class="icon-back"></span></a>
		<span>修改角色</span>
	</div>



	<div class="panel charger">
		<form id="updateForm" class="form-horizontal" role="form"
			onsubmit="return validateCallback(this, role.update);">
			<div class="numbResult">基本信息</div>
			<input type="hidden" name="id" class="form-control"
				value="${result.data.id }">

			<div class="form-group">
				<label class="col-sm-2 control-label"><span class="col_red">*</span>角色名称：</label>
				<div class="col-sm-10 ">
					<div class="pr">
						<input type="text" name="name" class="form-control" required
							data-bv-notempty placeholder="请输入角色名称"
							value="${result.data.name }" data-bv-stringlength-max="100"  data-bv-stringlength="true">
					</div>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label"><span class="col_red">*</span>角色类型：</label>
				<div class="col-sm-10 ">
					<select id="roletype" name="roleType">
						<option value="请选择">请选择</option>
						<option value="1">中支管理员</option>
						<option value="2">征信业务科组</option>
						<option value="3">查询员</option>
						<option value="4">分管征信行领导</option>
						<option value="5">业务管理</option>
						<option value="6">异议处理</option>
					</select>
				</div>
			</div>
			<script type="text/javascript">
			var roleType=${result.data.roleType};//角色类型
			$("#roletype").find("option[value='"+roleType+"']").attr("selected",true);
			</script>
			<div class="form-group">
				<label class="col-sm-2 control-label">描述：</label>
				<div class="col-sm-10">
					<!--<input type="text" class="form-control" placeholder="请输入办公电话">-->
					<textarea class="form-control" name="note" rows="6" data-bv-stringlength-max="500"  data-bv-stringlength="true">${result.data.note }</textarea>
				</div>
			</div>

			<div class="numbResult">权限列表</div>

			<!--  
			<div class="numbResult">
				<c:forEach items="${result.data.useMenuList }" var="row"
					varStatus="status">
					<label class="control-label">${row.menuName }</label>
				</c:forEach>
			</div>
	-->
			<div class="treelayout" id="authList">
				<ul>
					<c:forEach items="${result.data.menuList}" var="row" varStatus="status">
						<li>
							<h4>

								<label for="sys_0"><input type="checkbox" <c:if  test="${row.isCheck eq '1'}">checked="checked"</c:if>  
							    	class="syscheckBox" name="rootMenuList" id="rootMenuList" value="${row.id }" />${row.name }</label>
								
							</h4>
							<ul>
								<c:forEach items="${row.childList}" var="subrow" varStatus="status">
									<li>
										<h4>

											<label for="sys_0_1"><input type="checkbox"
												<c:if  test="${subrow.isCheck eq '1' || row.isCheck eq '1'}">checked="checked"</c:if> class="syscheckBox" name="menuList"
												id="menuList" value="${subrow.id }-${row.id }" />${subrow.name }</label>							

										</h4>
									</li>
								</c:forEach>
							</ul>
						</li>
					</c:forEach>
				</ul>
			</div>

			<div class="text-center opareBtm">

				<button type="submit" class="a-btn1">确定</button>
				<button type="button" onclick="menuUrl('role/view', 'role:page');"
					class="a-btn1 grey">返回</button>

			</div>

		</form>



	</div>

	<!--end content-->
	<div class="clearfix"></div>
</div>
<script src="resources/js/page/authList.js"></script>